package com.pubinfo.passbook.data.service;

import com.alibaba.fastjson.JSONObject;
import com.pubinfo.passbook.common.entity.TFileInfo;
import com.pubinfo.passbook.common.entity.TNewSourceInvoice;
import com.pubinfo.passbook.common.model.dto.open.InvoiceParam;
import org.springframework.web.bind.annotation.RequestBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Date;

public interface VoucherFileService {

    JSONObject invoiceOdf2Json(String fileId) throws Exception;

    JSONObject ofd2Json(String filePath,String fileName,String type) throws Exception;

    void getOfdXml(HttpServletRequest request, HttpServletResponse response, TFileInfo tFileInfo) throws Exception;

    /**
     * 解析发票ofd并保存
     * @param filePath
     * @param fileName
     * @param machiningDate
     * @return
     * @throws Exception
     */
    TNewSourceInvoice ofdAnalysis(String filePath, String fileName, Date machiningDate) throws Exception;

    /**
     * 获取发票的相关文件
     * @param request
     * @param response
     * @param invoiceParam
     * @throws Exception
     */
    void getInvoiceFile(HttpServletRequest request, HttpServletResponse response,InvoiceParam invoiceParam) throws Exception;
}
